package com.chalk.config.rabbit;

import com.alibaba.fastjson.JSONObject;
import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.core.ChannelAwareMessageListener;
import org.springframework.stereotype.Component;

/**
 * 消息接收监听
 * @date: 2019-05-07 下午 12:33
 * @author: zhaobo0119@outlook.com
 * @Descriptopn:
 */
//@Component
public class ReceiveConfirmListener implements ChannelAwareMessageListener {

    /**
     * 回调处理收到的Rabbit消息。
     * @param message 收到的AMQP消息
     * @param channel 小i通道
     * @throws Exception
     */
    @Override
    public void onMessage(Message message, Channel channel) throws Exception {
        System.out.println("-----------message------------"+JSONObject.toJSONString(message));
        System.out.println("-----------message------------"+JSONObject.toJSONString(channel));
    }
}
